// 全局变量 - 与其他页面保持一致
@primary-color: #4a90e2; // 柔和的蓝色
@secondary-color: #8dc6ff; // 次要颜色
@card-radius: 16px; // 增加圆角
@box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.08), 0 12px 32px 0 rgba(0, 0, 0, 0.03);
@transition-duration: 0.4s;
@text-color: #4a5568; // 柔和的文字颜色
@text-color-secondary: #64748b;
@border-color: #e6e9f0; // 柔和的边框颜色
@padding-lg: 24px;
@padding-md: 16px;
@background-color-base: transparent;

// 容器样式
.container {
  position: relative;
  animation: fadeIn 0.6s ease-out;
  background: transparent;
  min-height: calc(100vh - 120px);
  
  :global {
    .ant-pro-page-container-children-content {
      margin: 24px;
      
      @media screen and (max-width: 768px) {
        margin: 16px;
      }
    }
  }
}

// 卡片基础样式混合
.cardBase() {
  box-shadow: @box-shadow;
  border-radius: @card-radius;
  overflow: hidden;
  transition: all @transition-duration;
  background: white;
  margin-bottom: 24px;
  
  &:hover {
    box-shadow: 0 14px 28px -8px rgba(74, 144, 226, 0.1), 0 16px 32px 0 rgba(0, 0, 0, 0.04);
    transform: translateY(-3px);
  }
}

// 表单卡片
.formCard {
  .cardBase();
  
  :global {
    .ant-card-body {
      padding: @padding-md;
      background: white;
    }
  }
}

// 内容卡片
.contentCard {
  .cardBase();
  
  :global {
    .ant-card-head {
      border-bottom: 1px solid @border-color;
      padding: 0 @padding-md;
      background: linear-gradient(to right, fadeout(@primary-color, 96%), transparent);
    }
    
    .ant-card-body {
      padding: @padding-md;
    }
  }
}

// 搜索表单
.searchForm {
  padding: 8px 0;
  animation: fadeIn 0.6s ease-out;
  
  :global {
    .ant-form-item {
      margin-bottom: 16px;
    }
    
    .ant-form-item-label > label {
      color: @text-color;
      font-weight: 500;
    }
    
    .ant-input,
    .ant-select-selector,
    .ant-picker {
      border-radius: 8px;
      border-color: @border-color;
      transition: all 0.3s;
      
      &:hover,
      &:focus {
        border-color: @primary-color;
        box-shadow: 0 0 0 2px fade(@primary-color, 10%);
      }
    }
    
    .ant-select-selector {
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    }
  }
}

// 表单按钮区域
.formButtons {
  :global {
    .ant-btn {
      border-radius: 8px;
      height: 36px;
      transition: all 0.3s;
      
      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      }
      
      &.ant-btn-primary {
        background: @primary-color;
        border-color: @primary-color;
        
        &:hover {
          background: lighten(@primary-color, 5%);
          border-color: lighten(@primary-color, 5%);
        }
      }
    }
  }
}

// 标题栏
.headerWrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 0;
}

.cardTitle {
  margin: 0 !important;
  color: @text-color;
  position: relative;
  font-weight: 500 !important;
  font-size: 16px !important;
  letter-spacing: 0.3px;
  
  &::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    background-color: @primary-color;
    margin-right: 10px;
    border-radius: 4px;
    opacity: 0.8;
    vertical-align: -2px;
  }
}

.headerActions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lastUpdated {
  font-size: 14px;
  color: @text-color-secondary;
}

.refreshButton {
  display: flex;
  align-items: center;
  border-radius: 8px;
  background: @primary-color;
  border-color: @primary-color;
  transition: all 0.3s;
  
  &:hover {
    transform: translateY(-2px);
    background: lighten(@primary-color, 5%);
    border-color: lighten(@primary-color, 5%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  }
}

// 表格样式
.tableContainer {
  animation: fadeInUp 0.6s ease-out;
  border-radius: 8px;
  overflow: hidden;
}

.dataTable {
  :global {
    .ant-table {
      background: transparent;
      
      th {
        background: #f8fafc;
        font-weight: 500;
        color: @text-color;
        padding: 14px 12px;
        border-bottom: 1px solid @border-color;
        transition: background 0.3s;
        
        &:hover {
          background: rgba(74, 144, 226, 0.05);
        }
      }
      
      td {
        transition: all @transition-duration;
        border-bottom: 1px solid #f1f5f9;
        padding: 12px;
        color: @text-color-secondary;
      }
      
      tr {
        transition: all @transition-duration;
        
        &:hover > td {
          background-color: rgba(74, 144, 226, 0.03) !important;
        }
        
        &.ant-table-row:nth-child(odd) {
          background-color: #fcfdff;
        }
        
        &.ant-table-row:nth-child(even) {
          background-color: white;
        }
        
        &:hover {
          box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.06);
          z-index: 2;
          position: relative;
        }
      }
    }
    
    // 分页控件样式
    .ant-pagination {
      margin: 20px 16px;
      text-align: right;
      
      .ant-pagination-item {
        border-radius: 8px;
        transition: all @transition-duration;
        border: 1px solid @border-color;
        
        a {
          transition: all @transition-duration;
          color: @text-color;
        }
        
        &:hover {
          border-color: @primary-color;
          
          a {
            color: @primary-color;
          }
        }
      }
      
      .ant-pagination-item-active {
        border-color: @primary-color;
        background: rgba(74, 144, 226, 0.08);
        
        a {
          color: @primary-color;
          font-weight: 500;
        }
        
        &:hover {
          background: rgba(74, 144, 226, 0.12);
        }
      }
      
      .ant-pagination-prev,
      .ant-pagination-next {
        .ant-pagination-item-link {
          border-radius: 8px;
          color: @text-color;
          
          &:hover {
            color: @primary-color;
            border-color: @primary-color;
          }
        }
      }
    }
    
    // 滚动条样式
    .ant-table-body {
      &::-webkit-scrollbar {
        width: 6px;
        height: 6px;
      }
      
      &::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 10px;
      }
      
      &::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 10px;
      }
    }
  }
}

// 操作列样式
.actionColumn {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.editLink {
  color: @primary-color;
  
  &:hover {
    color: lighten(@primary-color, 10%);
    text-decoration: underline;
  }
}

.deleteLink {
  color: #ef4444;
  
  &:hover {
    color: lighten(#ef4444, 10%);
    text-decoration: underline;
  }
}

// 加载动画
.spinner {
  width: 100%;
  min-height: 300px;
  
  :global {
    .ant-spin-dot-item {
      background-color: @primary-color;
    }
    
    .ant-spin-text {
      color: @primary-color;
    }
  }
}

// 响应式样式调整
@media screen and (max-width: 768px) {
  .formCard,
  .contentCard {
    margin-bottom: 16px;
    
    :global {
      .ant-card-head {
        padding: 0 12px;
      }
      
      .ant-card-body {
        padding: 12px;
      }
    }
  }
  
  .headerWrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
  }
  
  .headerActions {
    width: 100%;
    justify-content: space-between;
  }
  
  .searchForm {
    :global {
      .ant-form-item {
        margin-bottom: 12px;
      }
    }
  }
}

// 动画定义
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
} 